/* 
 *  javascribd - Java client library for the Scribd API. 
 *  Copyright (C) 2009 by Marcel Eyke, http://code.google.com/p/javascribd/ 
 *  Use is subject to license terms of LGPLv3. See license.txt. 
 */
package com.google.code.javascribd.type;

public class SessionKey {
	private final String sessionKey;

	public SessionKey(String sessionKey) {
		if (sessionKey == null) {
			throw new IllegalArgumentException("sessionKey must be not null");
		}
		this.sessionKey = sessionKey;
	}

	public String getSessionKey() {
		return sessionKey;
	}

	@Override
	public int hashCode() {
		assert sessionKey != null;
		return sessionKey.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SessionKey other = (SessionKey) obj;
		assert sessionKey != null;
		assert other.sessionKey != null;
		return sessionKey.equals(other.sessionKey);
	}

	@Override
	public String toString() {
		assert sessionKey != null;
		return sessionKey.toString();
	}
}
